<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<style type="text/css">
body {
	background-attachment: fixed;
	background-color: #000000;
	/* 	background: #1d1d1d; */
	/*  	background-image: url("..//imagens/page_bg_center.jpg");  */
	background-repeat: repeat;
	border: 0 none;
	color: #B5B5B5;
	font-family: 'Lucida Grande', 'Lucida Sans', Verdana, sans-serif;
	font-size: 12px;
	margin: 0;
	padding: 0;
	width: 100%;
	
}

#body {
	border: 1px solid #1E1E1E;
	width: 1000px;
	min-height: 750px;
	margin-left: auto;
	margin-right: auto;
	margin-top: 50px;
	margin-left: auto;
	margin-bottom: 50px;
	padding-top: 10px;
}

#interruptor {
	background-image: url(..//imagens/interruptorOFF.png);
	background-repeat: no-repeat;
	background-color: #000000;
	width: 100px;
	border: 0px;
	margin: 0px;
	height: 100px;
	padding: 0px;
}

#interruptor:HOVER {
	background-image: url(..//imagens/interrutorON.png);
}

.text_box {
	height: 20px;
	width: 300px;
	border: 1px solid #1E1E1E;
	float: right;
	color: #1d1d1d;
	font-family: 'Lucida Grande', 'Lucida Sans', Verdana, sans-serif;
	font-size: 12px;
	margin: 0px;
}

#lampada {
	height: 400px;
	width: 300px;
	
	margin-right: 10px;
	float: right;
}

#lampada img {
	
	margin-left: 100px;
}
#luz_texto{
	
	width: 300px;
	min-height:100px;
	margin-right: 10px;
	float: right;
	text-align: center;
	margin-bottom: 10px;
	margin-top: 100px;
}
#padrao_de_luz {
	min-height: 450px;
	width: 600px;
	border: 1px solid #1E1E1E;
	margin-left: 10px;
	float: left;
}

#inf {
	min-height: 40px;
	width: 600px;
}

#test img: {
	height: 60px;
	width: 60px;
	border: 3px solid red;
}

#cadeado {
	text-align: center;
}

#footer {
	text-align: center;
	width: 60px;
	width: 100%;
	padding-bottom: 20px;
}
</style>
<title>Gstv.Inc &copy;&reg;| Disjuntor</title>
</head>
<body>


<?php
include_once 'padraoDeLuz.php';
// testa a coneccao
if (!$con)
{
	$erro_var = 'Could not connect:<br />';
	$mysqlError = mysql_error();
	$lampada = "lampada_OFF.png";
}
else
{
	// Descomente a linha abaixo para testar a coneccao apontando o firefox para este arquivo
	$erro_var = "<img src='../imagens/upg.gif' alt='' />Energia ligada!";
	$lampada = "lampada_ON.png";

}
$db_selecionada = mysql_select_db("$host_db",$con );
if (!$db_selecionada)
{
	$erro_var ="<img src='../imagens/Warning.png' alt='' /> Could not select DB:<br />";
	$mysqlError = mysql_error()."<br />Cheque os campos abaixo.[Algun Deles esta ERRADO!!]";
	$lampada = "lampada_OFF.png";
}else{
	$erro_var = "<img src='../imagens/upg.gif' alt='' />Energia ligada! Tudo [OK] Com a Database";
	$lampada = "lampada_ON.png";
}
?>

	<div id="body">
		<div id="cadeado">
			<fieldset>
				<legend>Insira o SERIAL</legend>			
 <?php 
if (isset($_GET['chaveTest'])and $_GET['chaveTest']==$serialize){
				echo "<form action='disjuntor.php' method='post'>
						 <input type='password' name='chaveTest' value='Travar!!'  title='Coloque aqui o serial.'/>
						 <input type='submit' value='Travar' title='Clique em [Branco/ou serial errado] Para travar.'/>
						 </form>";
				echo "Destravado.<br /><img src='../imagens/unlock.png'/>";
					
		
				}elseif (isset($_POST['chaveTest'])and $_POST['chaveTest']==$serialize){
				echo "<form action='disjuntor.php' method='post'>
				         <input name='chaveTest' type='password' value='Travar'  title='Coloque aqui o serial.'/>
						 <input type='submit' value='Travar' title='Clique em [Branco/ou serial errado] Para travar.'/>
						 </form>";
				echo "Destravado.<br /><img src='../imagens/unlock.png'/>";
				
				}else{
					echo "<form action='disjuntor.php' method='post'>
					     <input type='password' name='chaveTest' value=''  title='Coloque aqui o serial.'/>
						 <input type='submit' value='Destravar'/>
						 </form>";
					die("vc precisa destravar pra rodar!!<br /><img src='../imagens/lock.png'/>");
				}
 ?>
 </fieldset>

		</div>

		<div id="padrao_de_luz">
			<div id="inf">
			<?php
			if (isset($_GET['chaveTest'])and $_GET['chaveTest']==$serialize){
				echo "<fieldset><legend>Aviso!</legend>$erro_var.<br />";
				if(isset($mysqlError)){
					echo $mysqlError."</fieldset>";
				}else{echo "</fieldset>";}
			}elseif (isset($_POST['chaveTest'])and $_POST['chaveTest']==$serialize){
				echo "<fieldset><legend>Aviso!</legend>$erro_var.<br />";
				if(isset($mysqlError)){
					echo $mysqlError."</fieldset>";
				}else{echo "</fieldset>";}
			}


			?>
			</div>

			<form action="disjuntor.php" method="post">

					<fieldset>
						<legend>Host:</legend>
						<input class="text_box" type="text"
							value="<?php if (isset($_GET['chaveTest'])and $_GET['chaveTest']==$serialize){ echo $host; }elseif (isset ($_POST['chaveTest']) and $_POST['chaveTest']==$serialize){ echo $host; }else {echo 'Voce Nao Tem Permicao Pra Ver As Configuracoes.';};?>" /><br />
					</fieldset>
	
					<fieldset>
						<legend>Host User:</legend>
						<input class="text_box" type="text"
							value="<?php if (isset($_GET['chaveTest'])and $_GET['chaveTest']==$serialize) { echo $host_user; }elseif (isset ($_POST['chaveTest']) and $_POST['chaveTest']==$serialize){ echo $host_user; }else {echo 'Voce Nao Tem Permicao Pra Ver As Configuracoes.';};?>" /><br />
					</fieldset>
	
					<fieldset>
						<legend>Senha:</legend>
						<input class="text_box" type="text"
							value="<?php if (isset($_GET['chaveTest'])and $_GET['chaveTest']==$serialize) { echo $host_pw; }elseif (isset ($_POST['chaveTest']) and $_POST['chaveTest']==$serialize){ echo $host_pw; }else {echo 'Voce Nao Tem Permicao Pra Ver As Configuracoes.';};?>" /><br />
					</fieldset>
	
					<fieldset>
					<legend>Database:</legend>
					<input class="text_box" type="text"
						value="<?php if (isset($_GET['chaveTest'])and $_GET['chaveTest']==$serialize) { echo $host_db; }elseif (isset ($_POST['chaveTest']) and $_POST['chaveTest']==$serialize){ echo $host_db; }else {echo 'Voce Nao Tem Permicao Pra Ver As Configuracoes.';};?>" /><br />
				</fieldset>
			
					<?php if (isset($_GET['chaveTest'])and $_GET['chaveTest']==$serialize) { 
							$chave = $_GET['chaveTest'];
							echo "<input name='chaveTest' type='hidden' value = $chave />"; 
							
						}elseif (isset($_POST['chaveTest'])and $_POST['chaveTest']==$serialize){
							$chave = $_POST['chaveTest'];
							echo "<input name='chaveTest' type='hidden' value = $chave />";
							
						}
					?>	
					
			
			
				</div>
				<!-- padrao_de_luz -->
				<div id="lampada">
					<img src="..//imagens/<?php echo $lampada; ?>" alt="lampada" />
					<div id="luz_texto"><?php 
					if ($lampada=="lampada_ON.png"){
						echo "E Parece Que Voce Pagou A conta De Luz.<br />
						Parabens Sua coneccao Tem [Luz].";
					}else {
						echo "E Parece Que Voce <b>NAO</b> Pagou A conta De Luz.<br />
										Cheque Se Sua coneccao Tem [Luz] Ela Ta Apaga? RsRs..<br />";
					}
					?>
			<input  id="interruptor" type="submit" value="" title="Ligue para Re-testar a coneccao!"/>
			</form>
			</div>
		</div>
	</div>
	<!-- body -->

	<div id="footer">Gstv.Inc &copy;&reg; 2010 | 2011</div>
</body>
</html>
